//
//  String.swift
//  ios_swift_demo1
//
//  Created by liutao on 2020/7/20.
//  Copyright © 2020 lt. All rights reserved.
//

import Foundation

//MARK:大于10000的string转换为.1w
extension String {
    var readability: String {
        let num:Int = Int(self) ?? 0
        if num < 10000 {
            return self
        } else {
            return String(format: "%.1fw", Int(self) ?? 0 / 10000)
        }
    }
}
